/**
 * Created by wzq on 15-3-28.
 */

var mongodb = require('./mongodb.js');
var Schema = mongodb.Schema;

var scoreSchema = new Schema({

	author_id: String,
	author_name: String,
	author_avatar: String,

	//
	share_id: String,
	score_value: Number,
	verify_status: String,

	//
	created_at: Date,
});

scoreSchema.pre('save', function(next) {
	var currentDate = new Date();
	if (!this.created_at) {
		this.created_at = currentDate;
	}
	next();
});

var Score = mongodb.model('Score', scoreSchema);

module.exports = Score;
